import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

//引入axios插件
import './plugins/axios'

//element-ui
import ElementUI from "element-ui"
import 'element-ui/lib/theme-chalk/index.css';
//view-design
import ViewUI from 'view-design'
import 'view-design/dist/styles/iview.css'


Vue.config.productionTip = false

Vue.use(ElementUI)
Vue.use(ViewUI)    //引用完后注册一下


Vue.directive('loadMore', {
  bind(el, binding) {
    // 获取element，定义scroll
    let select_dom = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap');
    select_dom.addEventListener('scroll', function () {
      let height = this.scrollHeight - this.scrollTop <= this.clientHeight;
      if (height) {
        binding.value()
      }
    })
  }
});

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
